package com.oweight.sagacious.auth.server.interfaces.feign;

import com.oweight.sagacious.api.model.user.PersonInfo;
import com.oweight.sagacious.auth.server.infrastructure.configuration.FeignConfiguration;
import com.oweight.sagacious.auth.server.infrastructure.util.user.JwtAuthenticationRequest;
import com.oweight.sagacious.auth.server.infrastructure.util.user.WeChatLoginForm;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author 周广明
 * @version v1 2019/10/21 16:59
 */
@FeignClient(value = "${jwt.user-service}", configuration = FeignConfiguration.class)
public interface OrganizationService {

    /**
     * 用户校验（登录）
     *
     * @param authentication
     * @return
     */
    @RequestMapping(value = "/api/user/validate", method = RequestMethod.POST)
    PersonInfo validate(@RequestBody JwtAuthenticationRequest authentication);

    /**
     * 微信用户校验（登录）
     *
     * @param form
     * @return
     */
    @RequestMapping(value = "/user/wx/login", method = RequestMethod.POST)
    PersonInfo validate(@RequestBody WeChatLoginForm form);
}
